angular.module('Caltech')
 .controller('certificateItemViewController', function (
			$scope, Restangular, $stateParams, Constants) {
     'use strict';

     $scope.username = Constants.accountInfo.fullName;

     $scope.model = {
         customer: {
         },
         calibrationCycle: 6,
         calibrationDate: new Date(),
         standards: []
     };

     if ($stateParams.id) {
         Restangular.one('transaction', $stateParams.id).get().then(function (model) {
             $scope.model = model;
             model.calibrationDate = new Date(model.calibrationDate);
         });
     }

     $scope.back = function () {
         history.back();
     };
 });